import getAttr from '@/api/attrs'
const state = {
  attrsList:[]
}
const mutations = {
  SET_ATTRS_LIST(state,data){
    state.attrsList = data
  },
  RESET_ATTRS(state){  //三级为空时清空表格
    state.attrsList=[]
  }
}
const actions = {
  async getAttrsList({commit},{id1,id2,id3}){
    const res = await getAttr.getAttrsList(id1,id2,id3)
    // console.log(res)
    if(res.code===200){
      commit('SET_ATTRS_LIST',res.data)
    }
  }
}
export default {
  namespaced: true,
  state,
  mutations,
  actions
}